package com.yykj.tencent.im.server.model.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * 组内消息
 */
@Data
@Entity
public class GroupMessage {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty("群组 ID")
    @Column(length = 50)
    private String groupId;

    @ApiModelProperty("群组类型")
    @Column(length = 20)
    private String type;

    @ApiModelProperty("发送者")
    @Column(length = 50)
    private String fromAccount;

    @ApiModelProperty("请求的发起者")
    @Column(length = 50)
    private String operatorAccount;

    @ApiModelProperty("消息的序列号")
    @Column(length = 50)
    private Long msgSeq;

    @ApiModelProperty("消息的时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime msgTime;

    @ApiModelProperty("在线标志")
    private Integer onlineOnlyFlag;

    @ApiModelProperty("消息内容--json")
    @Column(length = 2000)
    private String msgBody;


    @ApiModelProperty("运行环境")
    @Column(length = 10)
    private String environment;

    @ApiModelProperty("资料名称")
    @Column(length = 200)
    private String name;

}
